/*
 * Software Atelier 4
 * Project 1
 * Exercise 1
 * Developers: Marcello Romanelli, Gerardo Caruso
 */

package sa4project1

import java.net.URL
import scala.xml.XML

object P1_ex1 {


  def main(args: Array[String]): Unit = {
    val twitter = "http://search.twitter.com/search.atom?q=lugano&rpp=1000";
    val url = new URL(twitter);
    val xml = XML.load(url.openConnection.getInputStream);      
      
    for(res <- (xml \\ "entry")){
      val title = res \\ "title"
      val author = res \\ "author" \\ "name";;
      val published = res \\ "published";
      val geo = res \\ "geo";
      println(published.text)
      println(author.text)
      println(title.text)
      println(geo.text)
    
    }
  }
}
